Jump to content

Talk:Sort (Unix)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Question on sorting a directory

[edit]

If anyone can tell me that "How can sort a directory by the size of the files?" Regards, Chouhan

A question like that, not directly related to the content of the article is better asked to your computer - if it's Unix, try "man ls". If Windows, "start --> Help and support". Or you may try the many help Usenet forums online. --Unixguy 15:14, 26 November 2006 (UTC)[reply]

Sort article - format and content

[edit]

I went ahead and added the requested example of sorting files by size to the article. I'd say that the format of the article isn't like other Unix commands, like file, for example. Also the content can be added to and improved upon. I'll see if I can do that later. --Unixguy 15:30, 26 November 2006 (UTC)[reply]

TSV (Tab Separated Values)

[edit]

The $'\t' is a nicer way of specifying than embedding a tab into a shell script. And some of the escaping methods fail, resulting in this fun message from sort:


sort: multi-character tab `\\t'

A nice article is: http://blog.jasoncust.com/2011/12/bash-sort-what-hell-is-up-with-tabs.html

I added two citations to sources for bash and Korn Shell. Admittedly, the escaping syntax will fail in csh and tcsh with:


csh % sort -t $'\t'

Illegal variable name.

csh %


CSH and older shells can use code like:


$ sort -t"`/bin/echo '\t'`"


or this:


$ sort -t `awk 'BEGIN{printf("\t");}'`


Lent (talk) 17:38, 1 February 2013 (UTC)[reply]

Sorting algorithm across Unixes

[edit]

It might be beneficial to list the different sorting algrothithms used by different implementations (for instance, BSD sort not just GNU sort...) — Preceding unsigned comment added by 96.2.125.52 (talk) 15:47, 14 January 2015 (UTC)[reply]

Conflict with Quicksort

[edit]

The page indicates that mergesort is the implementation for this, but according to the quicksort page, it is the Unix implementation. Needs citation? --ManOminous (talk) 18:36, 21 January 2015 (UTC)[reply]

example wrong?

[edit]

Could this example be wrong? I would expect Bob to be ranked third. And I wonder about the syntactic meaning of the second "," in "-k2,2," --Utonsal (talk) 11:39, 26 March 2024 (UTC)[reply]